package main

import (
	"fmt"
)

func main() {
	var i int
	var j int
	// 正九九乘法表
	for i = 1; i < 10; i++ {
		for j = 1; j <= i; j++ {
			fmt.Printf("%[1]v*%[2]v=%[3]v ", i, j, i*j)
		}
		fmt.Println()
	}
	fmt.Println("++++++++++++++++++++++++++++++++++++")
	// 倒九九乘法表
	for i := 9; i >= 1; i-- {
		for k := 9; k > i; k-- {
			fmt.Printf("       ")
		}
		for j := 1; j <= i; j++ {
			//  fmt.Printf("%[1]v*%[2]v=%[3]v ", i, j, i*j)
			s := fmt.Sprintf("%[1]v*%[2]v=%[3]v ", i, j, i*j)
			fmt.Printf("%7v", s)
		}
		fmt.Println()
	}
}
